<?php if (!defined("_ECRIRE_INC_VERSION")) return; if (class_exists('PdkMotArticleModel')) return;
/* Since in SPIP3 there is no spip_mots_articles table, this class is obsolete */
/**
 * SPIP Plugin Development Kit
 *
 * @author     Aleksey Yaroshchuk (aleksey.yaroshchuk@gmail.com)
 * @license    GNU/GPL
 * @package    plugins
 * @subpackage pdk
 * @category   outils
 * @copyright  (c) Aleksey Yaroshchuk 2011-2012
 * @link       http://www.spip-contrib.net/Developmet-Kit
 * @version    1.0.0
 */

//include_spip('classes/pdk_model');
include_spip('functions/pdk_common');
pdk_load_class('pdk_model', 'classes/');
/** 
 *  This is PDK SPIP Mot Article model
 *
 *  @author Aleksey Yaroshchuk (aleksey.yaroshchuk@gmail.com)
 */
class PdkMotArticleModel extends pdk_Model {
    public function __construct() {
        parent::__construct();
        $this->config_model();        
    }
    
    function config_model() {
        // Define main table:
        $this->main_table = 'spip_mots_articles';
        
        // Define primary key:
        $this->primary_key = 'id_mot';
        
        // Define main table fields:
        $this->main_fields['id_mot'] = 'id_mot'; 
        $this->main_fields['id_article'] = 'id_article';
                                                                                 
         // Define validation rules:
         $this->validation->set_rules( 
            array(
               array(
                     'field'   => 'id_mot',
                     'label'   => 'ID Mot',
                     'rules'   => ''
                  )
            )
         );                                     
    }
    
    public $test_data = array(
            array('id_mot'=>1, 'id_article'=>1),
            array('id_mot'=>1, 'id_article'=>2),
            array('id_mot'=>2, 'id_article'=>3),
            array('id_mot'=>2, 'id_article'=>4),
    );
}
?>